package 刷题;

import java.util.Scanner;

public class 十六进制转十进制 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String string = scanner.nextLine();
        System.out.print(Long.valueOf(string,16));
        /*
        Scanner scanner = new Scanner(System.in);
		String string = scanner.nextLine();
		System.out.print(Long.parseLong(string, 16));
         */
    }
}
